package com.market.service.impl;

import com.market.entity.IntoStorage;
import com.market.mapper.IntoStorageMapper;
import com.market.service.IntoStorageService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class IntoStorageServiceImpl implements IntoStorageService {

    @Resource
    private IntoStorageMapper intoStorageMapper;

    @Override
    public boolean addIntoStorageRecord(IntoStorage intoStorage) {
        boolean b = intoStorageMapper.addIntoStorageRecord(intoStorage);
        return b;
    }

    @Override
    public boolean updateRealIntoStorageNum(int id,int realIntoStorageNum) {
        return intoStorageMapper.updateRealIntoStorageNum(id,realIntoStorageNum);
    }

    @Override
    public boolean updateIntoStorageRecord(IntoStorage intoStorage) {
        boolean b = intoStorageMapper.updateIntoStorageRecord(intoStorage);
        return b;
    }

    @Override
    public IntoStorage selectARecord(int id) {
        IntoStorage intoStorage = intoStorageMapper.selectARecord(id);
        return intoStorage;
    }

    @Override
    public List<IntoStorageService> selectAllRecordsInADay(String intoStorageTime) {
        List<IntoStorageService> AllIntoStorages = intoStorageMapper.selectAllRecordsInADay(intoStorageTime);
        return AllIntoStorages;
    }

    @Override
    public boolean deleteARecord(int id) {
        boolean b = intoStorageMapper.deleteARecord(id);
        return b;
    }
}
